home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIResumableChannel.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  127 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIResumableChannel.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIResumableChannel_h__
  6. #define __gen_nsIResumableChannel_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIStreamListener; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIResumableChannel */
  21. #define NS_IRESUMABLECHANNEL_IID_STR "4ad136fa-83af-4a22-a76e-503642c0f4a8"
  22.  
  23. #define NS_IRESUMABLECHANNEL_IID \
  24.   {0x4ad136fa, 0x83af, 0x4a22, \
  25.     { 0xa7, 0x6e, 0x50, 0x36, 0x42, 0xc0, 0xf4, 0xa8 }}
  26.  
  27. class NS_NO_VTABLE nsIResumableChannel : public nsISupports {
  28.  public: 
  29.  
  30.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRESUMABLECHANNEL_IID)
  31.  
  32.   /**
  33.      * Prepare this channel for resuming. The request will not start until
  34.      * asyncOpen or open is called. Calling resumeAt after open or asyncOpen
  35.      * has been called has undefined behaviour.
  36.      *
  37.      * @param startPos the starting offset, in bytes, to use to download
  38.      * @param entityID information about the file, to match before obtaining
  39.      *  the file. Pass an empty string to use anything.
  40.      *
  41.      * During OnStartRequest, this channel will have a status of
  42.      *  NS_ERROR_NOT_RESUMABLE if the file cannot be resumed, eg because the
  43.      *  server doesn't support this. This error may occur even if startPos
  44.      *  is 0, so that the front end can warn the user.
  45.      * Similarly, the status of this channel during OnStartRequest may be
  46.      *  NS_ERROR_ENTITY_CHANGED, which indicates that the entity has changed,
  47.      *  as indicated by a changed entityID.
  48.      * In both of these cases, no OnDataAvailable will be called, and
  49.      *  OnStopRequest will immediately follow with the same status code.
  50.      */
  51.   /* void resumeAt (in unsigned long long startPos, in ACString entityID); */
  52.   NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString & entityID) = 0;
  53.  
  54.   /**
  55.      * The entity id for this URI. Available after OnStartRequest.
  56.      * @throw NS_ERROR_NOT_RESUMABLE if this load is not resumable.
  57.      */
  58.   /* readonly attribute ACString entityID; */
  59.   NS_IMETHOD GetEntityID(nsACString & aEntityID) = 0;
  60.  
  61. };
  62.  
  63. /* Use this macro when declaring classes that implement this interface. */
  64. #define NS_DECL_NSIRESUMABLECHANNEL \
  65.   NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString & entityID); \
  66.   NS_IMETHOD GetEntityID(nsACString & aEntityID); 
  67.  
  68. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  69. #define NS_FORWARD_NSIRESUMABLECHANNEL(_to) \
  70.   NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString & entityID) { return _to ResumeAt(startPos, entityID); } \
  71.   NS_IMETHOD GetEntityID(nsACString & aEntityID) { return _to GetEntityID(aEntityID); } 
  72.  
  73. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  74. #define NS_FORWARD_SAFE_NSIRESUMABLECHANNEL(_to) \
  75.   NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString & entityID) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResumeAt(startPos, entityID); } \
  76.   NS_IMETHOD GetEntityID(nsACString & aEntityID) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEntityID(aEntityID); } 
  77.  
  78. #if 0
  79. /* Use the code below as a template for the implementation class for this interface. */
  80.  
  81. /* Header file */
  82. class nsResumableChannel : public nsIResumableChannel
  83. {
  84. public:
  85.   NS_DECL_ISUPPORTS
  86.   NS_DECL_NSIRESUMABLECHANNEL
  87.  
  88.   nsResumableChannel();
  89.  
  90. private:
  91.   ~nsResumableChannel();
  92.  
  93. protected:
  94.   /* additional members */
  95. };
  96.  
  97. /* Implementation file */
  98. NS_IMPL_ISUPPORTS1(nsResumableChannel, nsIResumableChannel)
  99.  
  100. nsResumableChannel::nsResumableChannel()
  101. {
  102.   /* member initializers and constructor code */
  103. }
  104.  
  105. nsResumableChannel::~nsResumableChannel()
  106. {
  107.   /* destructor code */
  108. }
  109.  
  110. /* void resumeAt (in unsigned long long startPos, in ACString entityID); */
  111. NS_IMETHODIMP nsResumableChannel::ResumeAt(PRUint64 startPos, const nsACString & entityID)
  112. {
  113.     return NS_ERROR_NOT_IMPLEMENTED;
  114. }
  115.  
  116. /* readonly attribute ACString entityID; */
  117. NS_IMETHODIMP nsResumableChannel::GetEntityID(nsACString & aEntityID)
  118. {
  119.     return NS_ERROR_NOT_IMPLEMENTED;
  120. }
  121.  
  122. /* End of implementation class template. */
  123. #endif
  124.  
  125.  
  126. #endif /* __gen_nsIResumableChannel_h__ */
  127.